package com.speed.interceptor;


import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.kit.PropKit;

public class GlobalActionInterceptor implements Interceptor {

	@Override
	public void intercept(Invocation in) {

		Controller controller = in.getController();
		// 上下文路径
		String ctx = controller.getRequest().getContextPath();
		System.out.println("CTX  { " + ctx + "   }}");
		controller.getSession().setAttribute("ctx", ctx);
		String url = PropKit.get("staticURL");
		System.out.println(url);
		in.invoke();
	}
}
